package com.lebang.service.sys;

import com.lebang.domain.AppStoreCheck;
import com.lebang.entity.RequestHeaders;
import com.lebang.example.AppStoreCheckExample;
import com.lebang.mapper.AppStoreCheckMapper;
import com.lebang.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* app_store_check
* @Author hwq
* @Date 2020-07-17
*/
@Service
public class AppStoreCheckService extends BaseService<AppStoreCheck,Long, AppStoreCheckExample>{
@Autowired
private AppStoreCheckMapper appStoreCheckMapper;
    public AppStoreCheck selectByAppStore(RequestHeaders requestHeaders) {
        return appStoreCheckMapper.getByAppStore(requestHeaders.getAppStore());
    }
    public boolean check(RequestHeaders requestHeaders){
        AppStoreCheck vo=this.selectByAppStore(requestHeaders);
        if(vo==null){
            return false;
        }
        if (vo.getOpenCheck() == 1 && vo.getIsCheck() == 1) {
                return true;
        }
        return false;
    }
}
